<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('wechat_materials', function (Blueprint $table) {
            $table->id();
            $table->string('type')->index()->comment('素材类型');
            $table->string('media_id')->index()->comment('素材id');
            $table->json('content')->nullable()->comment('内容');
            $table->string('name')->nullable()->comment('名称');
            $table->string('url')->nullable()->comment('url');
            $table->timestamps();
            $table->comment('微信素材表');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('wechat_materials');
    }
};
